#ifndef QSFMLCANVAS_H
#define QSFMLCANVAS_H

#include "SFML/Graphics.hpp"
#include <qwidget.h>
#include <qtimer.h>

class QSFMLCanvas : public QWidget, public sf::RenderWindow
{
    //Integrating a SFML Window in a Qt Widget
public:
        QSFMLCanvas(QWidget* parent, const QPoint& position, const QSize& size, unsigned int frameTime = 0);
        virtual ~QSFMLCanvas();

private:
        virtual void OnInit();
        virtual void OnUpdate();
        virtual QPaintEngine* paintEngine() const;
        virtual void showEvent(QShowEvent*);
        virtual void paintEvent(QPaintEvent*);
        virtual void mousePressEvent(QMouseEvent *event);
        QTimer m_timer;
        bool m_initialized;
};

#endif // QSFMLCANVAS_H
